<%--
  Created by IntelliJ IDEA.
  User: WDD
  Date: 2019/6/1
  Time: 21:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="stylesheet" href="${APP_PATH}/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${APP_PATH}/css/font-awesome.min.css">
    <link rel="stylesheet" href="${APP_PATH}/css/main.css">
    <link rel="stylesheet" href="${APP_PATH }/css/pagination.css">
    <style>
        .tree li {
            list-style-type: none;
            cursor:pointer;
        }
        table tbody tr:nth-child(odd){background:#F4F4F4;}
        table tbody td:nth-child(even){color:#C00;}
    </style>
</head>

<body>

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <div><a class="navbar-brand" style="font-size:32px;" href="#">众筹平台 - 实名认证审核</a></div>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
                <jsp:include page="/WEB-INF/jsp/common/top.jsp"></jsp:include>
            </ul>
            <form class="navbar-form navbar-right">
                <input type="text" class="form-control" placeholder="Search...">
            </form>
        </div>
    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <div class="tree">
                <jsp:include page="/WEB-INF/jsp/common/menu.jsp"></jsp:include>
            </div>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="glyphicon glyphicon-th"></i> 数据列表</h3>
                </div>
                <div class="panel-body">
                    <form class="form-inline" role="form" style="float:left;">
                        <div class="form-group has-feedback">
                            <div class="input-group">
                                <div class="input-group-addon">认证状态</div>
                                <c:if test="${member.authstatus == 0}">
                                    <input style="margin-left: 20px;" disabled="" class="form-control has-success" type="text" value="未实名认证">
                                </c:if>
                                <c:if test="${member.authstatus == 1}">
                                    <input style="margin-left: 20px;" disabled="" class="form-control has-success" type="text" value="实名认证申请中">
                                </c:if>
                                <c:if test="${member.authstatus == 2}">
                                    <input style="margin-left: 20px;" disabled="" class="form-control has-success" type="text" value="已实名认证">
                                </c:if>

                            </div>
                        </div>
                        <br>
                        <hr style="clear:both;">

                        <div class="form-group has-feedback">
                            <div class="input-group">
                                <div class="input-group-addon">用户类型</div>
                                <c:if test="${member.usertype == 0}">
                                    <input style="margin-left: 20px;" disabled="" class="form-control has-success" type="text" value="个人">
                                </c:if>
                                <c:if test="${member.usertype == 1}">
                                    <input style="margin-left: 20px;" disabled="" class="form-control has-success" type="text" value="企业">
                                </c:if>

                            </div>
                        </div>
                        <br>
                        <hr style="clear:both;">

                        <div class="form-group has-feedback">
                            <div class="input-group">
                                <div class="input-group-addon">账户类型</div>
                                <input style="margin-left: 20px;" disabled="" class="form-control has-success" type="text" value="${member.accttype}">

                            </div>
                        </div>
                        <br>
                        <hr style="clear:both;">

                        <div class="form-group has-feedback">
                            <div class="input-group">
                                <div class="input-group-addon">真实姓名</div>
                                <input style="margin-left: 20px;" disabled="" class="form-control has-success" type="text" value="${member.realname}">
                            </div>
                        </div>
                        <br>
                        <hr style="clear:both;">

                        <div class="form-group has-feedback">
                            <div class="input-group">
                                <div class="input-group-addon">身份证号</div>
                                <input style="margin-left: 20px;" disabled="" class="form-control has-success" type="text" value="${member.cardnum}">
                            </div>
                        </div>
                        <br>
                        <hr style="clear:both;">

                        <div class="form-group has-feedback">
                            <div class="input-group">
                                <div class="input-group-addon">电话号码</div>
                                <input style="margin-left: 20px;" disabled="" class="form-control has-success" type="text" value="${member.telephone}">
                            </div>
                        </div>
                        <br>
                        <hr style="clear:both;">

                        <c:forEach items="${certs}" var="cert" >
                            <div class="form-group has-feedback">
                                <div class="input-group">
                                    <div class="input-group-addon">${cert.name}</div>
                                    <button style="margin-left: 20px;" type="button" class="btn btn-default btn-danger" onclick="showImg(this,${cert.id})">
                                        <span class="glyphicon glyphicon-question-sign"></span> 查看
                                    </button>
                                </div>
                                <img style="margin-top: 20px;margin-left: 20px ;display:none"  src="" width="400px" height="200px" >
                            </div>
                            <br>
                            <hr style="clear:both;">
                        </c:forEach>

                        <div style="margin-left: 800px">
                            <button style="margin-left: 20px;" type="button" class="btn btn-default btn-success" onclick="pass(${member.id})">
                                审核通过
                            </button>
                            <button style="margin-left: 20px;" type="button" class="btn btn-default btn-danger" onclick="dispass(${member.id})">
                                审核不通过
                            </button>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="${APP_PATH}/jquery/jquery-2.1.1.min.js"></script>
<script src="${APP_PATH}/bootstrap/js/bootstrap.min.js"></script>
<script src="${APP_PATH}/script/docs.min.js"></script>
<script type="text/javascript" src="${APP_PATH }/jquery/layer/layer.js"></script>
<script type="text/javascript" src="${APP_PATH }/script/menu.js"></script>
<script src="${APP_PATH}/jquery/pagination/jquery.pagination.js"></script>
<script type="text/javascript">
    $(function () {
        $(".list-group-item").click(function(){
            if ( $(this).find("ul") ) {
                $(this).toggleClass("tree-closed");
                if ( $(this).hasClass("tree-closed") ) {
                    $("ul", this).hide("fast");
                } else {
                    $("ul", this).show("fast");
                }
            }
        });

        showMenu();


    });

    function showImg(that,certid) {
        $.ajax({
            type: "POST",
            data: {"certid":certid},
            url: "${APP_PATH}/auth_cert/showImg.do",
            success:function (message) {
                if (message.success){
                    $(that).parent().next().css('display','block');
                    $(that).parent().next().attr("src",'${APP_PATH}/pics/cert/'+message.img);
                }else{

                }
            }
        });
    };


    function pass(id) {
        $.ajax({
            type: "POST",
            data: {"id":id},
            url: "${APP_PATH}/auth_cert/pass.do",
            success:function (message) {
                if (message.success){
                    window.location.href = "${APP_PATH}/auth_cert/index.htm";
                }else{

                }
            }
        });
    }

    function dispass(id) {
        $.ajax({
            type: "POST",
            data: {"id":id},
            url: "${APP_PATH}/auth_cert/dispass.do",
            success:function (message) {
                if (message.success){
                    window.location.href = "${APP_PATH}/auth_cert/index.htm";
                }else{

                }
            }
        });
    }




</script>
</body>
</html>

